<template>
  <el-alert
      :title="systemAlertProps.title"
      :type="systemAlertProps.type"
      :description="systemAlertProps.description"
      :closable="systemAlertProps.closable"
      :center="systemAlertProps.center"
      :close-text="systemAlertProps.closeText"
      :show-icon="systemAlertProps.showIcon"
      :effect="systemAlertProps.effect"
      class="wk-system-alert"
      @close="systemAlertClose"/>
</template>

<script setup>
// todo whf 这个组件没有使用，可以删除了
// 顶部系统消息
import {computed} from "vue";
import {useAppStore} from "@/store/modules/app.js";
import {adminConfigIgnoreCompanyStatusAPI} from '/src/api/admin/config.js'

import {useErpUserStore} from "../../../store/modules/usererp.js";

defineOptions({
  name: 'WkSystemAlert',

})


const systemAlertProps = computed(() => {
  const appStore = useAppStore();
  return appStore.systemAlertProps
})

/**
 * 系统消息关闭
 */
function systemAlertClose() {
  adminConfigIgnoreCompanyStatusAPI().then(res => {
    // this.$store.dispatch('SystemLogoAndName')
    const appStore = useAppStore();
    appStore.SystemLogoAndName()
  }).catch(err => {
    console.log("err", err)
  })
}
</script>


<style lang="scss" scoped>
.wk-system-alert {
  border-bottom: 1px solid #e6e6e6;
}
</style>
